import { getOrdersList } from '@/api/orders'

const state = {
  // 订单数据列表
  orderList: [],
  total: 0
}
const mutations = {
  initOrderList(state, payload) {
    state.orderList = payload.goods
    state.total = payload.total
  }
}
const actions = {
  async getOrderList(context, payload) {
    const res = await getOrdersList(payload)
    // console.log(res)
    context.commit('initOrderList', res)
  }
}
const getters = {}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
